package com.xoa.dev.keyYouth.controller;

import com.xoa.dev.keyYouth.model.PAdolescent;
import com.xoa.dev.keyYouth.service.PAdolescentService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/pAdolescent")
public class PAdolescentController {

    @Autowired
    private PAdolescentService pAdolescentService;

    @RequestMapping("/index")
    public String jsp(){
        return "app/infomation/infoYouth";
    }


    //添加
    @RequestMapping("/addPAdolescent")
    @ResponseBody
    public ToJson addPAdolescent(HttpServletRequest request, PAdolescent record){
        return pAdolescentService.addPAdolescent(request,record);
    }
    //查询 分页
    @RequestMapping("/selectPAdolescent")
    @ResponseBody
    public ToJson selectPAdolescent(Integer page, Integer pageSize, Boolean useFlag, PAdolescent record
    ){
        return pAdolescentService.selectPAdolescent(page,pageSize,useFlag,record);
    }
    //编辑
    @RequestMapping("/updatePAdolescent")
    @ResponseBody
    public ToJson updatePAdolescent(HttpServletRequest request,PAdolescent record){
        return pAdolescentService.updatePAdolescent(request,record);
    }
    //详情
    @RequestMapping("/selectPAdolescentById")
    @ResponseBody
    public ToJson selectPAdolescentInfo(Integer id){
        return pAdolescentService.selectInofPAdolescent(id);
    }
    //删除
    @RequestMapping("/deletePAdolescent")
    @ResponseBody
    public ToJson deletePAdolescent(HttpServletRequest request,Integer id){
        return pAdolescentService.deletePAdolescent(request,id);
    }

}
